package com.ruoyi.project.system.info.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.info.mapper.SocialInfoMapper;
import com.ruoyi.project.system.info.domain.SocialInfo;
import com.ruoyi.project.system.info.service.ISocialInfoService;
import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.project.system.file.service.IFileService;
import com.ruoyi.project.system.file.domain.File;
import org.apache.commons.collections4.CollectionUtils;

/**
 * 社保信息Service业务层处理
 * 
 * @author xn
 * @date 2024-10-18
 */
@Service
public class SocialInfoServiceImpl implements ISocialInfoService 
{
    @Autowired
    private SocialInfoMapper socialInfoMapper;
    @Autowired
    private IFileService fileService;

    /**
     * 查询社保信息
     * 
     * @param id 社保信息ID
     * @return 社保信息
     */
    @Override
    public SocialInfo selectSocialInfoById(Long id)
    {
        SocialInfo domain = socialInfoMapper.selectSocialInfoById(id);
        return domain;
    }

    /**
     * 查询社保信息列表
     * 
     * @param socialInfo 社保信息
     * @return 社保信息
     */
    @Override
    public List<SocialInfo> selectSocialInfoList(SocialInfo socialInfo)
    {
        return socialInfoMapper.selectSocialInfoList(socialInfo);
    }

    /**
     * 新增社保信息
     * 
     * @param socialInfo 社保信息
     * @return 结果
     */
    @Override
    public int insertSocialInfo(SocialInfo socialInfo)
    {
        socialInfo.setCreateTime(DateUtils.getNowDate());
        return socialInfoMapper.insertSocialInfo(socialInfo);
    }

    /**
     * 修改社保信息
     * 
     * @param socialInfo 社保信息
     * @return 结果
     */
    @Override
    public int updateSocialInfo(SocialInfo socialInfo)
    {
        socialInfo.setUpdateTime(DateUtils.getNowDate());
        return socialInfoMapper.updateSocialInfo(socialInfo);
    }

    /**
     * 删除社保信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSocialInfoByIds(String ids)
    {
        return socialInfoMapper.deleteSocialInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除社保信息信息
     * 
     * @param id 社保信息ID
     * @return 结果
     */
    @Override
    public int deleteSocialInfoById(Long id)
    {
        return socialInfoMapper.deleteSocialInfoById(id);
    }

    @Override
    public SocialInfo selectSocialByIdNo(SocialInfo socialInfo) {
        return socialInfoMapper.selectSocialByIdNo(socialInfo);
    }
}
